/**
 * @param {string[]} strs
 * @return {string}
 */
 var longestCommonPrefix = function (strs) {
    let ans = ''
    for (let i of strs[0]) {
      if (!strs.every((item) => item.startsWith(ans + i))) {
        break
      }
      ans += i
    }
    return ans
  };
  
  